package com.ryskoo.cms.customerservice.repository;

import com.ryskoo.cms.customerservice.domain.CustomerServicePO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

/**
 * @author renyuting
 * @data 2018-04-23
 */
@Primary
@Repository
public class CustomerServiceRedisImpl extends BasicRedisImpl<CustomerServicePO>
		implements ICustomerServiceRepository {

	private static final String KEY_PRE = "CMS_CUSTOMERSERVICE_";

	@Autowired
	private RedisUtil redisClient;

	@Autowired
	private ICustomerServiceRepository customerServiceRepository;

	@PostConstruct
	public void init() {
		this.setRedisClient(redisClient);
		this.setDao(customerServiceRepository);
	}

	public CustomerServiceRedisImpl() {
		super(KEY_PRE);
	}
}
